﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace MODASA.HojaDefinicionProducto
{
    public partial class HDPVentan_Parabrisa_Mampara : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["HDP"] == null)
            {
                Page.Response.Redirect("HDPModelos.aspx");

            }  
        }

        protected void RBLVIGICOVI_SelectedIndexChanged(object sender, EventArgs e)
        {
            CargarImgVigiaTrasera(RBLVIGICOVI.Text);
        }

        private void CargarImgVigiaTrasera(string res)
        {

            if (RBLVIGICOVI.Text == "SI")
            {
                HLVIGIATRAS.Visible = true;
                HLVIGIATRAS.ImageUrl = "../images/Buses/ImgInt/Ventana-Parabrisa-Mampara/m_VigiaTrasera.jpg";
                HLVIGIATRAS.NavigateUrl = "../images/Buses/ImgInt/Ventana-Parabrisa-Mampara/VigiaTrasera.jpg";
            }
            else
            {
                HLVIGIATRAS.Visible = false;
            }
        }   


        protected void RBLMAMSAL1N_SelectedIndexChanged(object sender, EventArgs e)
        {
            CargarImgMamparas(RBLMAMSAL1N.Text);
        }

        private void CargarImgMamparas(string res)
        {

            if (RBLVIGICOVI.Text == "SI")
            {
                HLMAMPSAL.Visible = true;
                HLMAMPSAL.ImageUrl = "../images/Buses/ImgInt/Ventana-Parabrisa-Mampara/m_Mampara.jpg";
                HLMAMPSAL.NavigateUrl = "../images/Buses/ImgInt/Ventana-Parabrisa-Mampara/Mampara.jpg";
            }
            else
            {
                HLMAMPSAL.Visible = false;
            }
        }

        protected void RBLVIDLAT1N_SelectedIndexChanged(object sender, EventArgs e)
        {
            CargarImgVentanas(RBLVIDLAT1N.Text,1);
        }

        private void CargarImgVentanas(string res, int niv) {
            HLVIDRI1N.Visible = true;
            if (niv == 1)
            {
                
                HLVIDRI1N.NavigateUrl = "../images/Buses/ImgInt/Ventana-Parabrisa-Mampara/" + res + ".jpg";
                HLVIDRI1N.ImageUrl = "../images/Buses/ImgInt/Ventana-Parabrisa-Mampara/m_" + res + ".jpg";
            }
            else {
                HLVIDRI2N.NavigateUrl = "../images/Buses/ImgInt/Ventana-Parabrisa-Mampara/" + res + ".jpg";
                HLVIDRI2N.ImageUrl = "../images/Buses/ImgInt/Ventana-Parabrisa-Mampara/m_" + res + ".jpg";            
            }   
            
            }

        protected void RBLVIDLAT2N_SelectedIndexChanged(object sender, EventArgs e)
        {
            CargarImgVentanas(RBLVIDLAT2N.Text, 2);
        }

    }
}